<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <link rel="stylesheet" href="./css/横向.css">
</head>

<body>
  <div id="box">
    <ul>
      <li class="current"><img src="images/1.jpg" /></li>
      <li class="small"><img src="images/2.jpg" /></li>
      <li class="small"><img src="images/3.jpg" /></li>
      <li class="small"><img src="images/4.jpg" /></li>
      <li class="small"><img src="images/5.jpg" /></li>
    </ul>
  </div>

  <script src="./js/jquery-3.6.0.js"></script>
  <script>
    // 找到所有的li，注册鼠标移入事件。 --> 让当前的li宽度变为 900；它的兄弟宽度变为100
    $('li').on('mouseenter', function () {
      // $(this).css('width', '900px').siblings().css('width', '100px');
      $(this).stop().animate({ width: '900px' }, 500).siblings().stop().animate({ width: '100px' }, 500);
    })
  </script>
</body>

</html>